Spatial Data = Coordinates + Coordinate Reference System (CRS)
A common CRS is latitude/longitude
| Type | Latitude | Longitude |
|---|---|---|
| Standard | 44.57808N | 123.2803W |
| Coding | 44.57808 | -123.2803 |
| +N, -S | +E, -W |
Often it is written as: (longitude, latitude)
Thus: (-123.2803, 44.57808)
| Name | Code |
|---|---|
| World Geodetic System 1984 (WGS 84) | 4326 |
| NAD83 / New York Long Island | 2263 |
#ny_counties <- read_sf(dataset with county shapefiles)
borough_halls <- tibble(lon = c(-73.990540,
-73.923790,
-73.921090,
-74.075960,
-74.003740),
lat = c(40.692631,
40.826270,
40.743600,
40.642400,
40.713010),
boro = c("Brooklyn",
"Bronx",
"Queens",
"Staten Island",
"Brooklyn"))
borough_halls_geo <- borough_halls %>%
st_as_sf(coords = c("lon", "lat"),
crs = 2263)
ggplot() +
geom_sf(data = ny_counties) +
geom_sf(data = borough_halls_geo) +
theme(axis.text.x = element_blank(),
axis.text.y = element_blank(),
axis.ticks = element_blank(),
rect = element_blank())